// @AutoGenerate Version 2.17.8
package sysin

import (
	"context"
	"hotgo/internal/model/entity"
	"hotgo/internal/model/input/form"

	"github.com/gogf/gf/v2/frame/g"
)

// ErpUpdateFields 修改erp字段过滤
type ErpUpdateFields struct {
	StoreId   int    `json:"storeId"   dc:"门店ID"`
	StoreName string `json:"storeName" dc:"门店名称"`
	WH_DES    string `json:"WH_DES"     dc:"erp仓库名称"`
	WH_CD     string `json:"WH_CD"      dc:"erp仓库编码"`
}

// ErpInsertFields 新增erp字段过滤
type ErpInsertFields struct {
	StoreId   int    `json:"storeId"   dc:"门店ID"`
	StoreName string `json:"storeName" dc:"门店名称"`
	WH_DES    string `json:"WH_DES"     dc:"erp仓库名称"`
	WH_CD     string `json:"WH_CD"      dc:"erp仓库编码"`
}

// ErpEditInp 修改/新增erp
type ErpEditInp struct {
	entity.Erp
}

func (in *ErpEditInp) Filter(ctx context.Context) (err error) {
	// 验证门店ID
	if err := g.Validator().Rules("required").Data(in.StoreId).Messages("门店ID不能为空").Run(ctx); err != nil {
		return err.Current()
	}

	return
}

type ErpEditModel struct{}

// ErpDeleteInp 删除erp
type ErpDeleteInp struct {
	Id interface{} `json:"id" v:"required#主键不能为空" dc:"主键"`
}

func (in *ErpDeleteInp) Filter(ctx context.Context) (err error) {
	return
}

type ErpDeleteModel struct{}

// ErpViewInp 获取指定erp信息
type ErpViewInp struct {
	Id int64 `json:"id" v:"required#主键不能为空" dc:"主键"`
}

func (in *ErpViewInp) Filter(ctx context.Context) (err error) {
	return
}

type ErpViewModel struct {
	entity.Erp
}

// ErpListInp 获取erp列表
type ErpListInp struct {
	form.PageReq
	Id        int64  `json:"id" dc:"主键"`
	StoreId   *int   `json:"storeId"   dc:"门店ID"`
	StoreName string `json:"storeName" dc:"门店名称"`
	WH_DES    string `json:"WH_DES"     dc:"erp仓库名称"`
	WH_CD     string `json:"WH_CD"      dc:"erp仓库编码"`
}

func (in *ErpListInp) Filter(ctx context.Context) (err error) {
	return
}

type ErpListModel struct {
	Id        int64  `json:"id"        dc:"主键"`
	StoreId   int    `json:"storeId"   dc:"门店ID"`
	StoreName string `json:"storeName" dc:"门店名称"`
	WH_DES    string `json:"WH_DES"     dc:"erp仓库名称"`
	WH_CD     string `json:"WH_CD"      dc:"erp仓库编码"`
}

// ErpExportModel 导出erp
type ErpExportModel struct {
	Id        int64  `json:"id"        dc:"主键"`
	StoreId   int    `json:"storeId"   dc:"门店ID"`
	StoreName string `json:"storeName" dc:"门店名称"`
	WH_DES    string `json:"WH_DES"     dc:"erp仓库名称"`
	WH_CD     string `json:"WH_CD"      dc:"erp仓库编码"`
}
